© Copyright Microsoft Corporation, 2004. All rights reserved.
The SQL Server documentation team cannot answer technical support questions, but welcomes your suggestions and comments about this readme documentation. You can quickly and directly send e-mail feedback using the link below. Please send feedback in English.
To submit written feedback about this document, click here: Submit feedback.
The Microsoft® SQL Server™ 2000 Sample Database Scripts include new versions of two scripts included with SQL Server 2000:
These copies of the scripts are the same as the versions included with SQL Server 2000, except for these changes:
SQL Server 2000 Desktop Engine (MSDE 2000) customers can also use these copies of the scripts to install pubs and Northwind.
The user running the SQL Server 2000 Sample Database Scripts must have CREATE DATABASE permissions.
The scripts can be used with the following versions of SQL Server 2000:
The SQL Server 2000 Sample Database Scripts are available as an installation file, SQL2000SampleDb.msi, which can be downloaded by following the instructions on this Web site.
After downloading SQL2000SampleDb.msi, extract the sample database scripts by double-clicking SQL2000SampleDb.msi. SQL2000SampleDb.msi will extract the database scripts and this readme file into this default folder:
C:\Program Files\SQL Server 2000 Sample Databases
To install the sample databases, you:
SQL Server 2000 customers can perform these tasks using either the osql utility or the graphical utilities SQL Query Analyzer and SQL Enterprise Manager. MSDE 2000 only includes the osql command prompt utility.
Caution Instpubs.sql drops any existing version of the pubs sample database and Instnwnd.sql drops any existing copy of the Northwind sample database before creating new copies of the databases.
To run the scripts using SQL Query Analyzer:
To run the scripts using osql:
cd c:\program files\SQL Server 2000 Sample Databases
osql -E -i instnwnd.sql
osql -E -S ComputerName -i instpubs.sql
osql -E -S ComputerName/InstanceName -i instnwnd.sql
The login you use when running a SQL Server 2000 Sample Database Script becomes the owner of the sample database created by the script, and all of the objects in the sample database. That login and any login in the sysadmin fixed server role have permission to access the data and objects in the sample database. All other logins must be given permissions before they can access the sample data and objects.
A member of the sysadmin fixed server role or the db_accessadmin and db_owner fixed database roles must:
You can use Enterprise Manager to grant access to the database:
In either osql or SQL Query Analyzer you can use the sp_grantdbaccess system stored procedure to grant access to the sample database:
USE pubs; GO sp_grantdbaccess N'login_name', N'database_user_account'; GO
For more information about granting logins access to a database, see the following topics in the SQL Server Books Online:
Granting a Windows User or Group Access to a Database
Granting a SQL Server Login Access to a Database
Once a login has been associated with a user account in the sample database, a member of the sysadmin fixed server role or the db_accessadmin and db_owner fixed database roles must grant that user account permissions to access database objects.
You can use Enterprise Manager to grant access to the database:
In either osql or SQL Query Analyzer you can use the GRANT statement to grant permissions on database objects. First execute a USE <database_name> statement. To grant execute permission on a stored procedure, use:
GRANT EXECUTE ON [dbo].[database_object_name] TO [database_user_account]; GO
To grant data read and modification permissions, use:
GRANT SELECT , INSERT , DELETE , UPDATE ON [dbo].[database_object_name] TO [database_user_account]; GO
For more information about granting permissions in a database, see the following topic in the SQL Server Books Online: